package bookstudytest;

import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

/**
 * @Auther: Lee
 * @Date: 2018/7/23 16:55
 * @Description:
 */
public class RandomDemo {
    public static void main(String[] args) {
        Random random = new Random();
        ThreadLocalRandom threadLocalRandom = ThreadLocalRandom.current();
        for (int i = 0; i < 1000; i++) {
            //0~19随机数 包括19   0<= randomNumber<20
            int n = random.nextInt(20);
            // 20<= random<100
            threadLocalRandom.nextInt(20, 100);
            //long 与上面一样
            System.out.println(n);
        }

    }
}
